import { addChainToBlock } from 'utils'

/**
 * 添加链到metamask 网络中
 * @returns 返回一个函数
 */
export const useAddEthereumChain = () => {
    return async (id: number) => {
        try {
            await addChainToBlock(id)
        } catch (ex) {
            console.log(ex)
        }
    }
}